<?php
include($_SERVER["DOCUMENT_ROOT"] . "/bob.php");
include($_SERVER["DOCUMENT_ROOT"] . "/fonctions_mysqli.php");

$mysqli = new_mysqli($host, $user, $password, $database); //connection à la DB
$variable_get = filter_input_array(INPUT_GET);

$query="SELECT user_id,username FROM gens WHERE LOWER(username) LIKE LOWER('".$variable_get['username']."%') AND user_id!=".$_SESSION['id']." ORDER BY username LIMIT 0,5";
$result=  mysqli_query_with_error($mysqli, $query);
$retour="";
if ($result->num_rows >0){
    
    while($ligne=$result->fetch_array()){
        if ($retour!=""){
        $retour.="|";
    }
        $retour.=$ligne['username'].'|'.$ligne['user_id'];
    }
    echo $retour;
}